import request from '@/utils/request'

// 生成二维码
export function batchCreate(data) {
  return request({
    url: 'api/accessControl/batchCreate',
    method: 'post',
    data
  })
}

// 下载二维码
export function exportQRCode(data) {
  return request({
    url: 'api/accessControl/export',
    method: 'post',
    data,
    responseType: 'blob'
  })
}

// 查询历史分享
export function queryAllGroupBy(params) {
  return request({
    url: 'api/accessControl/queryAllGroupBy',
    method: 'get',
    params
  })
}

// 查询二维码版次下拉框
export function queryAcQrcode(params) {
  return request({
    url: 'api/accessControl/queryAcQrcode',
    method: 'get',
    params
  })
}

// 查询历史下载
export function queryRecord(params) {
  return request({
    url: 'api/accessControl/queryRecord',
    method: 'get',
    params
  })
}

// 删除二维码
export function deleteAccessControlItem(ids) {
  return request({
    url: 'api/accessControl/deleteAccessControlItem/',
    method: 'delete',
    data: ids
  })
}

export default { batchCreate, exportQRCode, queryAllGroupBy, queryAcQrcode, queryRecord, deleteAccessControlItem }
